import WaterfallFlow from '@/pages/waterfallFlow/index.tsx'
import UnequalHeightVirtualScroll from '@/pages/unequalHeightVirtualScroll/index.tsx'
import Test from '@/pages/test/index.tsx'
import RollingSuspension from '@/pages/rollingSuspension/index.tsx'
import Print from '@/pages/print/index.tsx'
import ParticleText from '@/pages/particleText/index.tsx'
import MagnifyingGlass from '@/pages/magnifyingGlass/index.tsx'
import LazyImg from '@/pages/lazyImg/index.tsx'
import Home from '@/pages/home/index.tsx'
import EqualHeightVirtualScroll from '@/pages/equalHeightVirtualScroll/index.tsx'
import EnlargePreview from '@/pages/enlargePreview/index.tsx'
import Ellipsis from '@/pages/ellipsis/index.tsx'
import DigitalRain from '@/pages/digitalRain/index.tsx'
import BlobUse from '@/pages/blobUse/index.tsx'
import App from '../App.tsx'
import NotFound from '../pages/404.tsx'
import { createBrowserRouter, Navigate } from 'react-router-dom'
let childrenList = [{"title":"首页","sortInd":"0","path":"home","element":<Home />},{"title":"Canvas粒子文字","sortInd":"1","path":"particleText","element":<ParticleText />},{"title":"Blob的使用场景","path":"blobUse","sortInd":"14","element":<BlobUse />},{"title":"数字雨","path":"digitalRain","sortInd":"14","element":<DigitalRain />},{"title":"自适应省略号","path":"ellipsis","sortInd":"14","element":<Ellipsis />},{"title":"hook实现放大浏览","path":"enlargePreview","sortInd":"14","element":<EnlargePreview />},{"title":"等高虚拟滚动","path":"equalHeightVirtualScroll","sortInd":"14","element":<EqualHeightVirtualScroll />},{"title":"懒加载图片","path":"lazyImg","sortInd":"14","element":<LazyImg />},{"title":"放大镜","path":"magnifyingGlass","sortInd":"14","element":<MagnifyingGlass />},{"title":"打印预览","path":"print","sortInd":"14","element":<Print />},{"title":"滚动悬浮","path":"rollingSuspension","sortInd":"14","element":<RollingSuspension />},{"title":"测试页面","path":"test","sortInd":"14","element":<Test />},{"title":"不等高虚拟列表","path":"unequalHeightVirtualScroll","sortInd":"14","element":<UnequalHeightVirtualScroll />},{"title":"响应式瀑布流","path":"waterfallFlow","sortInd":"14","element":<WaterfallFlow />}];

let children = childrenList.map((item) => {
  return {
    element:item.element,
    path: item.path,
  }
})

const router = createBrowserRouter([
  {
    path: "/",
    element: <App />,
    children,
  },
  {
    path: "/404",
    element: <NotFound />
  },
  {
    path: "*",
    element: <Navigate to='/404' />,
  },
])

let routeList = childrenList

export {
  routeList
}

export default router